﻿@using SW.Lite.Infrastructure.Helpers
@{
    Layout = null;
}

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width" />
    <title>StrongWorld</title>
    <link type="text/css" href="/Areas/Master/Common/css/common.css" rel="stylesheet" />
    <script src="/Areas/Master/Common/js/jquery-1.7.1.min.js"></script>
    <style type="text/css">
        #login-wrapper #login-content .notification { border: 0; background-color: #141414; color: #fff !important; padding: 5px; }

        body#login { color: #fff; background: #222 url('/Areas/Master/Common/images/bg-login.gif'); }

        #login-wrapper { background: url('/Areas/Master/Common/images/bg-login-top.png') top left repeat-x; }

            #login-wrapper #login-top { width: 100%; padding: 140px 0 50px 0; text-align: center; }

            #login-wrapper #login-content { text-align: left; width: 350px; margin: 0 auto; }

        .form .form-inline label { width: 60px; }
        .form .form-inline .form-item { margin-left: 80px; }

        #checkCode { width: 150px; }
    </style>
    <script type="text/javascript">
        function onSubmit() {
            var userName = $('#userName');
            if (userName.val().length <= 0) {
                userName.addClass('error');
                userName.focus();
                return false;
            }

            var password = $('#password');
            if (password.val().length <= 0) {
                password.addClass('error');
                password.focus();
                return false;
            }

            var checkCode = $('#checkCode');
            if (checkCode.val().length <= 0) {
                checkCode.addClass('error');
                checkCode.focus();
                return false;
            }
            return true;
        }
    </script>
</head>
<body id="login">
    <div id="login-wrapper">
        <div id="login-top">
            <img src="/Areas/Master/Common/images/Logo.png" alt="StrongWorld" />
        </div>
        <div id="login-content">
            @{
                if (ViewBag.LoginError != null && ViewBag.LoginError != "")
                {
                    <div class="notification inset">
                        <div style="background:url('/Areas/Master/Common/icons/16/lightbulb.png') left center no-repeat;padding-left:30px;">@ViewBag.LoginError</div>
                    </div>
                }
            }

            @using (Html.BeginForm("Index", "Login", FormMethod.Post, new { @class = "form", onsubmit = "return onSubmit();" }))
            {
                <div class="form-inline">
                    <div class="form-row">
                        <label>用户名</label>
                        <div class="form-item large">
                            @Html.TextBox("userName", null, new { @class = "textinput" })
                        </div>
                    </div>
                    <div class="form-row">
                        <label>密　码</label>
                        <div class="form-item large">
                            @Html.Password("password", null, new { @class = "textinput" })
                        </div>
                    </div>
                    <div class="form-row">
                        <label>验证码</label>
                        <div class="form-item large">
                            @Html.TextBox("checkCode", null, new { @class = "textinput", maxlength = "4" })
                            <img src="@Url.Action("CheckCode", "Login")" style="vertical-align: middle; margin: 0;" alt="CheckCode" />
                            @Html.Hidden("ReturnUrl", RequestHelper.Instance.QueryString("ReturnUrl"))
                        </div>
                    </div>
                    <div class="form-row" style="text-align: right;">
                        <input class="btn green" type="submit" value="登 录" />
                        <input class="btn green" type="reset" value="取 消" />
                    </div>
                </div>
            }
        </div>
    </div>
</body>
</html>
